Delete an item
Parent Type: LearningStoreJob
Namespace: Microsoft.LearningComponents.Storage
Assembly: Microsoft.LearningComponents.Storage.dll
| C# |
|
public void DeleteItem ( ) |
id
Identifies the item to be deleted
| Exception type | Condition |
| ArgumentNullException | id is a null reference. |
| Microsoft.LearningComponents.Storage.LearningStoreItemNotFoundException | The item was not found in the store. |
Steps required to delete an item from the store:
This operation does not return anything as a result.
If other items reference id, and id is marked as the "container" of those items, then the other items are also deleted.
The following code deletes the user with an Id of 50 from the store.
| C# |
// Create the Id
LearningStoreItemIdentifier id = new LearningStoreItemIdentifier("UserItem", 50);
// Create the job and add the "delete item" operation
LearningStoreJob job = store.CreateJob();
job.DeleteItem(id);
// Execute the job
job.Execute();
|